<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	String ope=request.getParameter("ope");
	if("addUser".equals(ope)){
		request.setAttribute("ope", ope);
	}
%>
<base href="<%=basePath%>" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<c:if test="${ope=='addUser' }"><h4>新增用户</h4></c:if>
<c:if test="${ope=='submitUser' }"><h4>修改用户信息</h4></c:if>
<c:if test="${ope=='viewUser' }"><h4>查看用户信息</h4></c:if>
	<form action="loginSer" method="post">
		<input type="hidden" name="ope" value="${ope}"/>
		<input type="hidden" name="id" value="${user.id }"/>
		登录名:<input type="text" name="loginName" placeholder="请输入登录名" value="${ope=='addUser'?'':user.loginName}"/></br>
		<c:if test="${ope == 'addUser'}">
			密码:<input type="password" name="pwd" placeholder="请输入密码"/></br>
			密码确认：<input type="password" name="pwdCfm" placeholder="请再输入一遍密码"/></br>
		</c:if>
		用户名:<input type="text" name="userName" placeholder="请输入用户名"value="${ope=='addUser'?'':user.userName}"/></br>
		性别：<input type="radio" name="sex" value="男" ${user.sex=='女'?'':'checked'}>男
		<input type="radio" name="sex" value="女" ${user.sex=='女'?'checked':''}>女</br>
		年龄:<input type="number" name="age" placeholder="请输入年龄"value="${ope=='addUser'?'':user.age}"/></br>
		<c:if test="${ope == 'addUser'|| ope == 'submitUser'}">
			<input type="submit"/>
			<input type="reset"/>
		</c:if>
	</form>
</body>
</html>